/**
 * @author zj
 * @desc:
 * @date: 2024/8/14 14
 */
import request from "@/request/index.js";

export function login(data) {
  return request({
    url: "/auth/login",
    method: "post",
    data,
  });
}

export function menuTree() {
  return request({
    url: "/system/menu/tree",
    method: "get",
  });
}

export function userInfo(param) {
  return request({
    url: `/system/user/info/${param}`,
    method: "get",
  });
}

export function getMenuList() {
  return request({
    url: "/system/menu/list",
    method: "get",
  });
}

export function loginOut(data) {
  return request({
    url: "/auth/logout",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data,
  });
}

export async function refreshToken(data) {
  return request({
    url: "/auth/refresh",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data,
  });
}
